cmake_minimum_required(VERSION 3.10.2)
project(test)

SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY output)

include_directories(sub)
add_subdirectory(sub)

#set(IMPORTED_LOCATION sub)
#add_executable(runtest IMPORTED)
add_executable(runtest main.cpp)
target_link_libraries(runtest test)

get_target_property(target_name runtest IMPORTED)
message(">>> ${target_name}")

add_executable(test_name ALIAS runtest)
get_target_property(alias_name test_name ALIASED_TARGET)
if(alias_name)
    message(">>> The name test_name is an ALIAS for ${alias_name}")
endif()

add_executable(test_name1 main.cpp)
target_link_libraries(test_name1 test)
get_target_property(alias_name1 test_name1 ALIASED_TARGET)
if(alias_name1)
    message(">>> The name test_name1 is an ALIAS for ${alias_name}")
else()
    message(">>> The name test_name1 has no ALIAS.")
endif()


